import { resultPageSuccess, resultSuccess } from "../_util";
import { MockMethod } from "vite-plugin-mock";

function getUserList() {
  return [
    {
      userId: 0,
      collegeId: 94,
      userCode: "test_cb1d719902db",
      userName: "test_a8aeb4fce7d2",
      collegeName: "test_23efd9ac278f",
    },
    {
      userId: 1,
      collegeId: 72,
      userCode: "test_7a847b09877a",
      userName: "test_c6d287f1c596",
      collegeName: "test_8d4512bb8f29",
    },
  ];
}

export default [
  {
    url: "/dev-api/user/tutorList",
    timeout: 100,
    method: "get",
    response: ({ query }) => {
      const { pageNum = 1, pageSize = 10 } = query;
      return resultPageSuccess(pageNum, pageSize, getUserList());
    },
  },
  {
    url: "/dev-api/user/getInfo",
    timeout: 100,
    method: "get",
    response: () => {
      return resultSuccess(getUserList().pop());
    },
  },
] as MockMethod[];
